﻿using UnityEngine;
using System;
using System.Collections;

namespace Hont
{
    public static class GameDateTimeParser
    {
        public static GameDateTime Parse(string str)
        {
            var year = 1;
            var month = 1;
            var day = 1;

            var split = str.Split('/');

            switch (split.Length)
            {
                case 2://   9/15
                    month = int.Parse(split[0]);
                    day = int.Parse(split[1]);
                    break;

                case 3://   9/15/2008
                    month = int.Parse(split[0]);
                    day = int.Parse(split[1]);
                    year = int.Parse(split[2]);
                    break;
            }

            return new GameDateTime(year, month, day);
        }
    }
}
